﻿using System.Windows.Controls;
using DALHelper.Business;
using System.Collections.Generic;
using System.Windows;

namespace ResortManager.Wizard
{
    /// <summary>
    /// Interaction logic for DefaultConfiguration1.xaml
    /// </summary>
    public partial class UTConfig0 : UserControl, IProceedureComponent
    {
        pgLookupTrans m_pgTrans;

        public UTConfig0()
        {
            InitializeComponent();

            m_pgTrans = new pgLookupTrans();
            frmTransLookup.Navigate(m_pgTrans);
            m_pgTrans.Width = frmTransLookup.Width;
            m_pgTrans.Height = frmTransLookup.Height;
        }

        #region IProceedureComponent Members

        public string KeyText
        {
            get { return "Chọn đoàn"; }
        }

        public bool RequestNext()
        {
            if (m_pgTrans.SelectedTransaction != null)
            {
                ParentWizard.WizardCommonData = m_pgTrans.SelectedTransaction;
                return true;
            }
            MessageBox.Show("Bạn phải chọn một đoàn khách để cập nhật!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            return false;
        }

        public void UpdateComponent()
        {
            m_pgTrans.UpdateData();
        }

        public ProceedureDialog ParentWizard
        {
            get;
            set;
        }

        #endregion
    }
}
